﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Management;

namespace iCPUApp.Code
{
    class Mainboard
    {
        ManagementObject mo;
        
        public Mainboard()
        {
            ManagementObjectSearcher mos = new ManagementObjectSearcher("select * from Win32_BaseBoard");
            ManagementObjectCollection moc = mos.Get();
            foreach (ManagementObject m in moc)
            {
                mo = m;
                break;
            }
        }

          public string GetStringProperty(string PropertyName)
          {
              try
              {
                  return mo.GetPropertyValue(PropertyName).ToString();
              }
              catch
              {
                  return "N/A";
              }
          }
          public string Caption
          {
              get{return GetStringProperty("Caption");}
          }
        
          public  string Depth
          {
              get{return GetStringProperty("Depth");}
          }
          public  string Description
          {
              get{return GetStringProperty("Description");}
          }
         public  string Height
          {
              get{return GetStringProperty("Height");}
          }
         public  string HostingBoard
          {
              get { return GetStringProperty("HostingBoard"); }
          }

          public  string HotSwappable
          {
              get{return GetStringProperty("HotSwappable");}
          }
          public  string Manufacturer
          {
              get{return GetStringProperty("Manufacturer");}
          }
          public  string Model
          {
              get{return GetStringProperty("Model");}
          }
          public  string Name
          {
              get{return GetStringProperty("Name");}
          }
           public  string OtherIdentifyingInfo
          {
              get{return GetStringProperty("OtherIdentifyingInfo");}
          }
          public  string PartNumber
          {
              get{return GetStringProperty("PartNumber");}
          }
           public  string Product
          {
              get{return GetStringProperty("Product");}
          }
           public  string IsRemovable
          {
              get{return GetStringProperty("Removable");}
          }
           public  string SerialNumber
          {
              get{return GetStringProperty("SerialNumber");}
          }
          public  string Tag
          {
              get{return GetStringProperty("Tag");}
          }
      
           public  string Version
          {
              get{return GetStringProperty("Version");}
          }
           public  string Weight
          {
              get{return GetStringProperty("Weight");}
          }
           
          public  string Width
          {
              get{return GetStringProperty("Width");}
          }

    }
}
